﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using mmoss.orm;



//setup class for global variables used in the POS
//I know, bad form, but, makes dev a lot easier

namespace mmoss.configuration
{
    static class Default
    {
        public static string USBScanString;
        public static bool USBScanInProgress=false;
        static Timer KeyTimer=new Timer();
        static User _currentUser;
        static int _currentGrowID;
        static Location _currentLocation;
        static short _currentMMC;
        static List<Patient> _loggedInPatients=new List<Patient>();
        private static bool _touchScreen = false;
        public static int CurrentGrowID
        {
            get { return _currentGrowID; }
            set { _currentGrowID = value; }
        }
        public static void StartTimer(int msTime)
        {
            if (KeyTimer.Enabled)
            {
                KeyTimer.Stop();
            }
            KeyTimer.Interval = msTime;
            KeyTimer.Enabled=true;
            KeyTimer.Tick += new EventHandler(KeyTimer_Tick);
            KeyTimer.Start();
        }

        static void KeyTimer_Tick(object sender, EventArgs e)
        {
            //end timer 
            KeyTimer.Stop();
            KeyTimer.Enabled = false;
            MessageBox.Show(USBScanString);
            USBScanInProgress = false;
        }
        public static bool TouchScreen
        {
            get { return _touchScreen; }
            set { _touchScreen = value; }
        }
        public static User CurrentUser
        {
            get { return _currentUser; }
            set { _currentUser = value; }
        }
        public static Location CurrentLocation
        {
            get { return _currentLocation; }
            set { _currentLocation = value; }
        }
        public static short CurrentMMCz
        {
            get { return _currentMMC; }
            set { _currentMMC = value; }
        }
        public static List<Patient> LoggedInPatients
        { 
            get{return _loggedInPatients;}
            set{_loggedInPatients=value;}
        }

    }
}
